/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     struct ListNode *next;
 * };
 */

typedef struct ListNode Node;
int kthToLast(struct ListNode* head, int k){
    Node *fast=head,*slow=head;
    while(--k){
        fast=fast->next;
    }
    while(fast->next){
        slow=slow->next;
        fast=fast->next;
    }
    return slow->val;
}
